package com.zenithmind.library.pojo.query;

import com.zenithmind.common.query.BaseQuery;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDate;

/**
 * 图书查询条件
 *
 * @author ZenithMind
 * @since 2024-06-14
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Schema(name = "图书查询条件", description = "图书查询的条件参数")
public class BookQuery extends BaseQuery {

    @Schema(description = "图书标题", example = "Java")
    private String title;

    @Schema(description = "ISBN", example = "9787111213826")
    private String isbn;

    @Schema(description = "分类ID", example = "1")
    private String categoryId;

    @Schema(description = "出版社ID", example = "1")
    private String publisherId;

    @Schema(description = "作者ID", example = "1")
    private String authorId;

    @Schema(description = "作者姓名", example = "Bruce Eckel")
    private String authorName;

    @Schema(description = "关键词搜索", example = "编程")
    private String keyword;

    @Schema(description = "图书类型 (0-纸质书, 1-电子书, 2-音频书)", example = "0")
    private Integer bookType;

    @Schema(description = "状态 (0-下架, 1-上架)", example = "1")
    private Integer status;

    @Schema(description = "是否推荐 (0-否, 1-是)", example = "1")
    private Integer isRecommended;

    @Schema(description = "是否新书 (0-否, 1-是)", example = "1")
    private Integer isNew;

    @Schema(description = "是否热门 (0-否, 1-是)", example = "1")
    private Integer isPopular;

    @Schema(description = "语言", example = "中文")
    private String language;

    @Schema(description = "出版开始日期", example = "2020-01-01")
    private LocalDate publishStartDate;

    @Schema(description = "出版结束日期", example = "2024-12-31")
    private LocalDate publishEndDate;

    @Schema(description = "最小价格", example = "0")
    private Double minPrice;

    @Schema(description = "最大价格", example = "200")
    private Double maxPrice;

    @Schema(description = "最小页数", example = "100")
    private Integer minPages;

    @Schema(description = "最大页数", example = "1000")
    private Integer maxPages;

    @Schema(description = "标签", example = "编程语言")
    private String tag;

    @Schema(description = "位置", example = "A区")
    private String location;

    @Schema(description = "排序字段", example = "createTime")
    private String sortField;

    @Schema(description = "排序方向 (asc/desc)", example = "desc")
    private String sortOrder;
}
